package Commnads;

import java.util.concurrent.Executor;

import Commnads.Commands.Command;

/**
 * This class enable us to execute each command in a thread.
 * each {@link Command} that would executed in thread, would inserted to the  {@link Executor}  
 * @author DROR
 */

public class RunCommand implements Runnable
{
	Command com;
	
	/**
	 * Constructor
	 * @param cm reference to new {@link Command}
	 */
	public RunCommand(Command cm)
	{
		com = cm;
	}
	
	/**
	 * This function executing the {@link Command} in thread
	 */
	public void run()
	{
		com.execute();
	}
}
